<!--
To change this template, choose Tools | Templates
and open the template in the editor.
-->
<!DOCTYPE html>
<html>
    <head>
        <title>Roles</title>
        <link type="text/css" rel="Stylesheet" href="jquery.validity.css" />
<link rel="stylesheet" type="text/css" href="css/main.css"/>


		
        <script type="text/javascript" src="jquery-1.6.4.min.js"></script>
        <script type="text/javascript" src="jquery.validity.min.js"></script>
        <script type="text/javascript" src="ckeditor/ckeditor.js"></script>
        <script type="text/javascript"  src="jquery-ui-1.8.18.custom.min.js"></script>
        <script type="text/javascript"  src="jquery.ui.datepicker-es.js"></script>
        <link rel="stylesheet" type="text/css" href="jquery-ui.css"/>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    </head>
    <body>
        <p align="left" style="font-size:18px; color:#FFF; background-color:#C29340; margin-top:12px; font-family:Calibri; text-align:30px; margin-left:20px; margin-right:20px; "> <strong>Roles</strong>
        <div id="formulario" align="center" style="margin-left:20px; margin-right:20px;">
        <form  name="formularioRoles">
        <table width="50%" border="0" cellspacing="15" align="center">
            <tr>
                <td style="text-align: right">Nombre </td>               
                <td ><input type="text" id="nombre" name="nombre" style="width: 80%"/></td>      
              </tr>
           
                  <td style="text-align: right">Descripcion</td>
                  <td><textarea id="descripcion" name="descripcion"style="width: 80%"></textarea></td>
            </tr>
            
            <tr><td style="text-align: right"><input type="button" name="guardar" id="guardar" value="Guardar"/></td><td><input type="button" name="cancelar" id="cancelar" value="Cancelar"/></td></tr>
            <input type="hidden" value="alta" name="funcion" id="action"/>
        </table>
        </form>
        </div>
    </p>
        <script type="text/javascript">
            $(function() { 
                
              $("#guardar")
                $.post( "../Roles/roles.php",  $("#formularioRoles").serialize(), function(data){
              
                  if(data==1)
                     { $( "#dialog:ui-dialog" ).dialog( "destroy" );
	
		$( "#dialog-message" ).dialog({
			modal: true,
			buttons: {
				Ok: function() {
					$( this ).dialog( "close" );
				}
			}
                });}});
                
                
                  
                $("#formularioRoles").validity(function() {

$("#nombre") .require().minLength(3);
                        
$("#descripcion").require()
                       


});
;
                </script>
    </body>
</html>
